{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. numpy图像数组的显示问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "from torch import nn\n",
    "import numpy as np\n",
    "import torch.nn.functional as F\n",
    "import matplotlib.pyplot as plt\n",
    "from torch import nn, optim\n",
    "from torch.autograd import Variable\n",
    "from torchvision import models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(28, 28, 3)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x1ee9b98ee10>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAHMZJREFUeJztnXd41GXWhp8TCD2U0MEgIEXBAhhYBUSKSFVEyopIU0FBVBBBxIKChaKgoqKUCBaKBTRKdUG6UhQQKVIjIDEQmpRgCLzfH4Rvs2zOSTYJM9l9n/u6vELmzpl5M8njLzNvOeKcAyHEP0KCPQBCSHBg+AnxFIafEE9h+AnxFIafEE9h+AnxFIafEE9h+AnxFIafEE/JGcgHk5AiDjnLqj5/gV1mfUGJUJ0rmsesDT+2yfR/HLHrj+fW/Q1nC5u1DnGmjylQyPRXnC1uepQ9o6pdIboDgMrbC5r+zzy/mz5fkl1/Kv9h1Z0tYv/6nYkrafrCV+01fe5jV6nu95A/zNqKsblMf6io/n0BQK7f7bHnrKA//uFCec3afOdPqO7IPoeTR5yYd3BxDOn5Ig0RaQ7gTQA5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jIdyKyVUQ2i8jjybcH9bkzxhWU5y3gf/aLSA4A2wE0BbAfwFoAnZxzWwI6EAURiQEQ6ZwL+pywiDQAcBLAh865a5NvGwXgiHNuRPL/OIs45+we4IEb2wsATga7c3NyQ5nSKTtLA7gLQHcE8bkzxtURQXjegnHlrwNgp3Nut3MuEcAMAG2CMI5sj3NuGYBLG8m3AXCxy8dUXPjlCTjK2LIFzrlY59xPyf8+AeBiZ+mgPnfGuIJCMMJfFsC+FJ/vR/Zq+e0ALBSRH0WkV7AHkwolk9umX2yfXiLI47mUNDs3B5JLOktnm+cuIx2vs5pghD+17j/ZacqhnnOuFoAWAB5J/vOWpI90dW4OFKl0ls4WZLTjdVYTjPDvBxCR4vMrABwIwjhSxTl3IPnjQQCzkf26D8ddbJKa/NFuGhdAslPn5tQ6SyMbPHfZqeN1MMK/FkBlEakgIrkA3AMgOgjj+DdEJH/yGzEQkfwAbkf26z4cDeDiqZrdAHwVxLH8C9mlc7PWWRpBfu6yW8froCzySZ7KeANADgBRzrmXAz6IVBCRirhwtQcunGw8LZhjE5HpABriwq6vOABDAXwJ4FMA5QDsBdDBORfwN96UsTXEhT9d/79z88XX2AEeW30AywFsAnA++eYhuPD6OmjPnTGuTgjC88YVfoR4Clf4EeIpDD8hnsLwE+IpDD8hnsLwE+IpDD8hnsLwE+IpDD8hnvJ/AMZNZ4Pi4kAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1ee9b920a58>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "img = np.random.rand(28,28,3)\n",
    "img = (img - img.min()) / (img.max()-img.min())   # 将原始缩放到 [0,1]\n",
    "# print(img)\n",
    "print(img.shape)\n",
    "plt.imshow(img,cmap='gray')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(28, 28)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x1ee9bba5ef0>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAGWZJREFUeJzt3Xlw1dXZB/DvI/suu0Ek8CKLiKAQ1BZFEFGsChXR1qqgpeK0OqPja9UyWpkOamtditQypWqVDgWpKNVWGFFcoIolgGURFdDIloKGHVmEPO8fub6TKud7YhLuTed8PzNOlm/OvYeb+3iTnN95jrk7RCQ9x+R6AiKSGyp+kUSp+EUSpeIXSZSKXyRRKn6RRKn4RRKl4hdJlIpfJFG1s3lnTZo08ZYtWwbz7du30/F169YNZrErFc2M5vXq1Ttq9x1z4MABmsfmfujQoWDG5g0ATZo0ofn69etpXr9+/Urffq1atejYTz/9lOa1a/OnL/u+HD58mI5t3rw5zWP/7j179tD84MGDwSz2XNy5c2cw279/Pw4ePMifMBlVKn4zGwpgIoBaAB5391+yr2/ZsiXuvvvuYD5z5kx6fx06dAhmsW9mnTp1aN6pUyeat2/fPpiVlpbSsbHi/eijj6o0fseOHcGsXbt2dOzgwYNpftNNN9G8S5cuNB80aFAwa9asGR07ZcoUmrdo0YLm7DnBCggALr/8cprH/t1vvfUWzYuKioJZ586d6di///3vwaywsJCOLa/SP/abWS0AjwG4EEAPAFeaWY/K3p6IZFdVfuc/HcBad//I3Q8CmAFgePVMS0SOtqoU//EANpT7eGPmc//BzMaaWaGZFe7evbsKdyci1akqxX+kX0S/9hcWd5/i7gXuXhD745KIZE9Vin8jgBPKfdwewOaqTUdEsqUqxb8YQBcz62RmdQF8H8AL1TMtETnarCpr1Gb2HQC/QdlS35Pufi/7+saNG/sp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CoBeBJd78365M4AjP7H5S92gNlnY3/nMu5mdl0AANRtutrC4B7AMwGMBNABwDrAVzu7ln/w1tgbgPxDU9uPkpzC50s/Q5y+NhV54nX1TIfXeEnkiZd4SeSKBW/SKJU/CKJUvGLJErFL5IoFb9IolT8IolS8Ysk6v8AzbVZRaR6PKMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1ee9b9b9198>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "img = np.random.randn(28,28)\n",
    "img = (img - img.min()) / (img.max()-img.min())   # 将原始缩放到 [0,1]\n",
    "# print(img)\n",
    "print(img.shape)\n",
    "plt.imshow(img,cmap='gray')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**总结：**\n",
    "1. 待显示图像的范围一定要在[0,1]内\n",
    "2. 显示3通道的图像，即使设置`cmap='gray'`，仍然会显示彩色图像\n",
    "3. 显示灰度图像，只能使用二维的数据，即(H,W)，如果使用三维数据(H,W,1)会报错"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. BCELoss函数测试"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.5308566093444824 1.5308566093444824\n"
     ]
    }
   ],
   "source": [
    "x = torch.randn(5,4)         # 注意标准正态分布，是 N(0,1)，但根据3sigma原则，范围大致在(-3,3)内\n",
    "y = torch.randn(5,4)\n",
    "scale = lambda x: (x-x.min())/(x.max()-x.min())\n",
    "x, y = map(scale, [x,y])\n",
    "# print(x.max(), y.min())\n",
    "loss = nn.BCELoss()(x, y)       # 只要数据和标签在[0,1]内，就可以使用该函数\n",
    "loss2 = F.binary_cross_entropy(x,y)\n",
    "print(loss.data.item(), loss2.data.item())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0.20194215  0.40662435 -1.94542454  1.83245898]\n",
      " [ 1.40685415 -1.15174771  0.17453342  1.7091495 ]\n",
      " [ 1.48218273 -0.74373852 -1.32357009  1.76813049]]\n",
      "\n",
      "[1.48218273 0.40662435 0.17453342 1.83245898]\n",
      "\n",
      "[[-1.28024058  0.         -2.11995796  0.        ]\n",
      " [-0.07532858 -1.55837206  0.         -0.12330947]\n",
      " [ 0.         -1.15036287 -1.49810351 -0.06432849]]\n"
     ]
    }
   ],
   "source": [
    "x = np.random.randn(3,4)\n",
    "print(x)\n",
    "print()\n",
    "print(np.max(x, 0))\n",
    "print()\n",
    "print(x -np.max(x, 0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'irange', 'make_grid', 'math', 'save_image', 'torch']\n"
     ]
    }
   ],
   "source": [
    "import torchvision.utils as t\n",
    "print(dir(t))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 损失函数的公式：\n",
    "\n",
    "nn.BCELoss"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$\\ell(x, y) = L = \\{l_1,\\dots,l_N\\}^\\top, \\quad\n",
    "    l_n = - w_n \\left[ y_n \\cdot \\log x_n + (1 - y_n) \\cdot \\log (1 - x_n) \\right]$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "nn.CrossEntropyLoss"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$\\text{loss}(x, class) = -\\log\\left(\\frac{\\exp(x[class])}{\\sum_j \\exp(x[j])}\\right)\n",
    "                   = -x[class] + \\log\\left(\\sum_j \\exp(x[j])\\right)$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3. unsqueeze函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([4])\n",
      "torch.Size([4, 1])\n",
      "torch.Size([1, 4])\n"
     ]
    }
   ],
   "source": [
    "a = torch.tensor([1,5,3,4])\n",
    "print(a.shape)\n",
    "b = a.unsqueeze(1)\n",
    "print(b.shape)\n",
    "c = a.unsqueeze(0)\n",
    "print(c.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 5, 3, 4], dtype=int64)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.numpy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([1, 3, 4, 5])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a[a.numpy().argsort()]           # 排序"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4. plot只能按照x自身元素的的顺序画图，无法区别大小"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "np.random.seed(7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1ee9d0697f0>]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yL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kSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1ee9cfe3a20>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.random.randn(10)\n",
    "y = np.random.randn(10)\n",
    "plt.subplot(121)\n",
    "plt.plot(x,y)                # 无序的数据画图的结果，尤其是画连续的曲线时需注意!!!\n",
    "plt.subplot(122)\n",
    "x = x[x.argsort()]           # 对x进行排序可以画出按顺序的直线\n",
    "plt.plot(x,y)                # 排序的数据画的结果"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5. filter过滤函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[1, 2, 6]]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(filter(lambda x: x[-1]==6, [[1,2,0],[1,2,3],[1,2,6],[1,2,0]]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100内的素数:\n",
      "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 "
     ]
    }
   ],
   "source": [
    "# 1.打印素数,除2的偶数都不是素数，所以从大于3的奇数中选就行\n",
    "# 这些高阶函数只需转入函数名就行，传入的参数一般只有一个\n",
    "def _odd_iter():   # 产生奇数的惰性序列，无穷的\n",
    "    n = 1\n",
    "    while True:\n",
    "        n += 2\n",
    "        yield n\n",
    "        \n",
    "def _not_divisible2(n):\n",
    "    return lambda x: x % n > 0\n",
    "#     return lambda x: True\n",
    "\n",
    "def primes():\n",
    "    yield 2\n",
    "    it = _odd_iter() # 初始序列\n",
    "    while True:\n",
    "        n = next(it) # 返回序列的第一个数\n",
    "        yield n\n",
    "        it = filter(_not_divisible2(n), it) # 构造新序列，注意这里使用函数调用，但返回值是函数\n",
    "        \n",
    "# 打印100以内的素数:\n",
    "print('100内的素数:')\n",
    "for n in primes():\n",
    "    if n < 100:\n",
    "        print(n, end=' ')\n",
    "    else:\n",
    "        break"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 6. shuffle"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3],\n",
       "       [1, 2, 3],\n",
       "       [7, 8, 9]])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import random\n",
    "a = np.array([[1,2,3],[4,5,6],[7,8,9]])\n",
    "random.shuffle(a)          # 作用于多维数组会出现重复的行\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([6, 4, 0, 2, 3, 1, 9, 7, 8, 5])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import random\n",
    "a = np.arange(10)\n",
    "random.shuffle(a)          # 作用于一维数组不会出现重复\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 7.IntTensor中的整除符号 '/'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor([0, 0, 1], dtype=torch.int32)\n",
      "tensor([0.3333, 0.6667, 1.0000])\n"
     ]
    }
   ],
   "source": [
    "a = torch.IntTensor([1,2,3])\n",
    "a\n",
    "print(a / 3)                  # PyTorch中的整型tensor使用整除\n",
    "print(a.float() / 3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.8\n",
      "0\n"
     ]
    }
   ],
   "source": [
    "print(4 / 5)                # python中 '/'表示普通的除法\n",
    "print(3 // 5)               # python中 '//'表示整除    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "InceptionAux(\n",
       "  (conv0): BasicConv2d(\n",
       "    (conv): Conv2d(768, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
       "    (bn): BatchNorm2d(128, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
       "  )\n",
       "  (conv1): BasicConv2d(\n",
       "    (conv): Conv2d(128, 768, kernel_size=(5, 5), stride=(1, 1), bias=False)\n",
       "    (bn): BatchNorm2d(768, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
       "  )\n",
       "  (fc): Linear(in_features=768, out_features=1000, bias=True)\n",
       ")"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "finetune= models.inception_v3(pretrained=False)\n",
    "new_model = nn.Sequential(*list(finetune.children())[:-1])\n",
    "new_model._modules.pop('13')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([1, 2048, 26, 26])\n"
     ]
    }
   ],
   "source": [
    "test_in = torch.randn([1,3,224,224]).to(torch.device('cuda'))\n",
    "new_model.to(torch.device('cuda'))\n",
    "out = new_model(test_in)\n",
    "print(out.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "BasicConv2d(\n",
      "  (conv): Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "  (bn): BatchNorm2d(32, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "BasicConv2d(\n",
      "  (conv): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), bias=False)\n",
      "  (bn): BatchNorm2d(32, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "BasicConv2d(\n",
      "  (conv): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "  (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "BasicConv2d(\n",
      "  (conv): Conv2d(64, 80, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  (bn): BatchNorm2d(80, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "BasicConv2d(\n",
      "  (conv): Conv2d(80, 192, kernel_size=(3, 3), stride=(1, 1), bias=False)\n",
      "  (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionA(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(192, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch5x5_1): BasicConv2d(\n",
      "    (conv): Conv2d(192, 48, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(48, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch5x5_2): BasicConv2d(\n",
      "    (conv): Conv2d(48, 64, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(192, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(64, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(96, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_3): BasicConv2d(\n",
      "    (conv): Conv2d(96, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(96, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(192, 32, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(32, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionA(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(256, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch5x5_1): BasicConv2d(\n",
      "    (conv): Conv2d(256, 48, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(48, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch5x5_2): BasicConv2d(\n",
      "    (conv): Conv2d(48, 64, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(256, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(64, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(96, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_3): BasicConv2d(\n",
      "    (conv): Conv2d(96, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(96, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(256, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionA(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(288, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch5x5_1): BasicConv2d(\n",
      "    (conv): Conv2d(288, 48, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(48, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch5x5_2): BasicConv2d(\n",
      "    (conv): Conv2d(48, 64, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(288, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(64, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(96, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_3): BasicConv2d(\n",
      "    (conv): Conv2d(96, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(96, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(288, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionB(\n",
      "  (branch3x3): BasicConv2d(\n",
      "    (conv): Conv2d(288, 384, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(288, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(64, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(64, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(96, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_3): BasicConv2d(\n",
      "    (conv): Conv2d(96, 96, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "    (bn): BatchNorm2d(96, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionC(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(128, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_2): BasicConv2d(\n",
      "    (conv): Conv2d(128, 128, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(128, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_3): BasicConv2d(\n",
      "    (conv): Conv2d(128, 192, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(128, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(128, 128, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(128, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_3): BasicConv2d(\n",
      "    (conv): Conv2d(128, 128, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(128, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_4): BasicConv2d(\n",
      "    (conv): Conv2d(128, 128, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(128, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_5): BasicConv2d(\n",
      "    (conv): Conv2d(128, 192, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionC(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 160, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_2): BasicConv2d(\n",
      "    (conv): Conv2d(160, 160, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_3): BasicConv2d(\n",
      "    (conv): Conv2d(160, 192, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 160, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(160, 160, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_3): BasicConv2d(\n",
      "    (conv): Conv2d(160, 160, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_4): BasicConv2d(\n",
      "    (conv): Conv2d(160, 160, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_5): BasicConv2d(\n",
      "    (conv): Conv2d(160, 192, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionC(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 160, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_2): BasicConv2d(\n",
      "    (conv): Conv2d(160, 160, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_3): BasicConv2d(\n",
      "    (conv): Conv2d(160, 192, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 160, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(160, 160, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_3): BasicConv2d(\n",
      "    (conv): Conv2d(160, 160, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_4): BasicConv2d(\n",
      "    (conv): Conv2d(160, 160, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(160, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_5): BasicConv2d(\n",
      "    (conv): Conv2d(160, 192, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionC(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_2): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7_3): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_3): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_4): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7dbl_5): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionD(\n",
      "  (branch3x3_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3_2): BasicConv2d(\n",
      "    (conv): Conv2d(192, 320, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "    (bn): BatchNorm2d(320, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7x3_1): BasicConv2d(\n",
      "    (conv): Conv2d(768, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7x3_2): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(1, 7), stride=(1, 1), padding=(0, 3), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7x3_3): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(7, 1), stride=(1, 1), padding=(3, 0), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch7x7x3_4): BasicConv2d(\n",
      "    (conv): Conv2d(192, 192, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionE(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(1280, 320, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(320, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3_1): BasicConv2d(\n",
      "    (conv): Conv2d(1280, 384, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3_2a): BasicConv2d(\n",
      "    (conv): Conv2d(384, 384, kernel_size=(1, 3), stride=(1, 1), padding=(0, 1), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3_2b): BasicConv2d(\n",
      "    (conv): Conv2d(384, 384, kernel_size=(3, 1), stride=(1, 1), padding=(1, 0), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(1280, 448, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(448, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(448, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_3a): BasicConv2d(\n",
      "    (conv): Conv2d(384, 384, kernel_size=(1, 3), stride=(1, 1), padding=(0, 1), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_3b): BasicConv2d(\n",
      "    (conv): Conv2d(384, 384, kernel_size=(3, 1), stride=(1, 1), padding=(1, 0), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(1280, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "InceptionE(\n",
      "  (branch1x1): BasicConv2d(\n",
      "    (conv): Conv2d(2048, 320, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(320, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3_1): BasicConv2d(\n",
      "    (conv): Conv2d(2048, 384, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3_2a): BasicConv2d(\n",
      "    (conv): Conv2d(384, 384, kernel_size=(1, 3), stride=(1, 1), padding=(0, 1), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3_2b): BasicConv2d(\n",
      "    (conv): Conv2d(384, 384, kernel_size=(3, 1), stride=(1, 1), padding=(1, 0), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_1): BasicConv2d(\n",
      "    (conv): Conv2d(2048, 448, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(448, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_2): BasicConv2d(\n",
      "    (conv): Conv2d(448, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_3a): BasicConv2d(\n",
      "    (conv): Conv2d(384, 384, kernel_size=(1, 3), stride=(1, 1), padding=(0, 1), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch3x3dbl_3b): BasicConv2d(\n",
      "    (conv): Conv2d(384, 384, kernel_size=(3, 1), stride=(1, 1), padding=(1, 0), bias=False)\n",
      "    (bn): BatchNorm2d(384, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      "  (branch_pool): BasicConv2d(\n",
      "    (conv): Conv2d(2048, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    (bn): BatchNorm2d(192, eps=0.001, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "------------------------------------------------------------------------------------------------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "for n in new_model.children():\n",
    "    print(n)\n",
    "    print('-----'*30)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
